<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head>
	<title>Pesquisa Processo</title>
</h:head>
<ui:composition template="templatePrincipal.xhtml">
	<ui:define name="header">
		<ui:include src="header.xhtml" />
	</ui:define>
	<ui:define name="centro">
		<h:body>
			<h:form id="form1">
				<p:panel header="Dados para pesquisa">
					<p:outputLabel for="pesqproponente" value="Proponente : " />
					<p:autoComplete id="pesqproponente"
						value="#{processoController.selectedCliente}"
						completeMethod="#{processoController.completeCliente}"
						var="cliente" itemLabel="#{cliente.proponente}"
						itemValue="#{cliente}" converter="clienteConverter" />

					<p:commandButton id="pesqprocessobnt" value="Pesquisar Processo"
						actionListener="#{processoController.pesquisaProcesso}"
						update="dataTable,p_observacoes" />

				</p:panel>

				<p:panel>

					<p:dataTable id="dataTable" var="chkline"
						value="#{processoController.processo.processoChkLine}"
						paginator="true" rows="10"
						paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
						rowsPerPageTemplate="10,15,20"
						selection="#{processoController.selectedChkLine}"
						selectionMode="single" rowKey="#{chkline.processChk_id}">
						<f:facet name="header">
            					Check List do processo
        				</f:facet>
						<p:column>
							<f:facet name="header">
								<h:outputText value="Descrição" />
							</f:facet>
							<h:outputText value="#{chkline.descricao}" />
						</p:column>

						<p:column>
							<f:facet name="header">
								<h:outputText value="Verificado" />
							</f:facet>
							<p:selectBooleanCheckbox value="#{chkline.checked}">
								<p:ajax event="change"
									listener="#{processoController.changeValue}" update="dataTable" />
							</p:selectBooleanCheckbox>
						</p:column>




					</p:dataTable>
				</p:panel>
				<p:panel header="Observações">
					<p:inputTextarea id="p_observacoes" rows="10" cols="100"
						value="#{processoController.processo.observacoes}" />

					<p:commandButton id="salvaprocessobnt" value="Salvar Processo"
						actionListener="#{processoController.salvarProcesso}"
						update="dataTable" />

				</p:panel>

			</h:form>
		</h:body>
	</ui:define>
</ui:composition>
</html>